﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Budgets.aspx.cs" Inherits="TempEmployees.Web.FormBudgets"
    Title="דוח תקציבים" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../UserControls/GridViews/GridViewDepartmentStatus.ascx" TagName="GridViewDepartmentStatus"
    TagPrefix="uc1" %>
<%@ Register Src="../UserControls/GridViews/GridViewAssignmentStatus.ascx" TagName="GridViewAssignmentStatus"
    TagPrefix="uc1" %>
<%@ Register Src="../UserControls/DataDisplay/DisplayDropList.ascx" TagName="DisplayDropList"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div dir="rtl">
        <table>
            <tr>
                <td>
                    <input type="radio" name="BudgetsDisplay" value="1" onclick="UpdateDisplay()" checked />הצג לפי פקולטה
                    <br />
                    <input type="radio" name="BudgetsDisplay" value="2" onclick="UpdateDisplay()" />הצג הכל
                </td>
                <td>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
                <td>
                    <uc1:DisplayDropList ID="DropDownListSemester" runat="server" AutoPostBack="false" />
                    &nbsp;
                    <asp:Button ID="ButtonUpdateGridViews" runat="server" Text="עדכן" OnClick="ButtonUpdateGridViews_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div id="PanelSelectLab" class="viscol">
        <fieldset>
            <table class="searchAssignments-table" dir="rtl">
                <tr>
                    <td valign="top" style="width:365px">
                        <fieldset>
                            <legend class="legend">מעבדות בפקולטה</legend>
                            <asp:Button ID="ExportToExcelDepartmentsStatus" runat="server" OnClick="ExportToExcelDepartmentsStatus_Click" Text="הפקת דוח" />
                            <br />
                            <asp:UpdatePanel ID="updatePanelViewBudget" runat="server">
                                <ContentTemplate>
                                    <uc1:GridViewDepartmentStatus ID="GridViewDepartmentStatus1" runat="server" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </fieldset>
                    </td>
                    <td valign="top" style="width:370px">
                        <fieldset>
                            <legend class="legend">העסקות במעבדה</legend>
                            <asp:Button ID="ExportToExcelAssignmentStatus" runat="server" OnClick="ExportToExcelAssignmentStatus_Click" Text="הפקת דוח" />
                            <br />
                            <asp:UpdatePanel ID="updatePanelAssignedBudgets" runat="server">
                                <ContentTemplate>
                                    <uc1:GridViewAssignmentStatus ID="GridViewAssignmentStatus1" runat="server" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </fieldset>
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
    <div id="PanelViewAll" class="hiddencol">
        <fieldset>
            <asp:UpdatePanel ID="UpdatePanelRepeater" runat="server">
                <ContentTemplate>
                    <asp:Repeater ID="RepeaterViewAll" runat="server" OnItemDataBound="RepeaterViewAll_ItemDataBound">
                        <HeaderTemplate>
                            <table dir="rtl">
                        </HeaderTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                        <SeparatorTemplate>
                            <tr>
                                <td>
                                    <br />
                                    <br />
                                </td>
                            </tr>
                        </SeparatorTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <asp:Label ID="LabelDepartmentName" runat="server"></asp:Label>
                                    <br />
                                    <uc1:GridViewAssignmentStatus ID="GridViewAssignmentStatus2" runat="server" />
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </ContentTemplate>
            </asp:UpdatePanel>
        </fieldset>
    </div>
    <script type="text/javascript">
        var COOKIES = "budgets_display";
        Init();
        function Init() {
            var checked = ReadCookie(COOKIES);
            if (!checked) return;
            document.getElementsByName("BudgetsDisplay")[0].checked = (checked == "0");
            document.getElementsByName("BudgetsDisplay")[1].checked = (checked == "1");
            UpdateDisplay();
        }
        function UpdateDisplay() {
            var checked = document.getElementsByName("BudgetsDisplay")[0].checked;
            CreateCookie(COOKIES, checked ? "0" : "1", 30);
            document.getElementById("PanelSelectLab").className = checked ? "viscol" : "hiddencol";
            document.getElementById("PanelViewAll").className = !checked ? "viscol" : "hiddencol";
        }
    </script>
</asp:Content>
